<style>
#uliceLokacije fieldset{
	margin-top:10px;
}
#uliceLokacije a.expand,
#uliceLokacije a.collapse{
	width:16px;
	height:16px;
	overflow:hidden;
	display:block;
	float:right;
	text-indent:-100em;
	overflow:hidden;
}
#uliceLokacije a.expand:hover,
#uliceLokacije a.expand{background:url(gui/record_next.gif) no-repeat center center}
#uliceLokacije a.collapse:hover,
#uliceLokacije a.collapse{background:url(gui/arrow_down.gif) no-repeat center center}
#uliceLokacije #ullokFilterForm{
	width:200px;
	overflow:auto;
}
#uliceLokacije #ullokNewForm{
	width:200px;
	margin-top:2px;
}
#uliceLokacije fieldset legend select{
	margin:0px 2px;
	float:none;
}
#uliceLokacije fieldset .lokholder{
	display:none;
}
#uliceLokacije #ullok_result{
	max-width:600px;
	overflow:auto;
	margin-left:2px;
}
#uliceLokacije #ullok_result table tr:hover{
	background:{{$highlight}};
	color:{{$highlighttext}};
}
#uliceLokacije #ullok_result table tr td input[type=button]{
	padding:0px;
	width:20px;
	height:20px;
}
</style>
<div id="uliceLokacije">
  <div style="float:left">
	<form id="ullokFilterForm" class="area" action="javascript:void(0)" onsubmit="submitForm(this,'geos.php','POST','setContent',1)">
		<input type="hidden" name="a" value="ulice_lokacije" />
		<a title="collapse/expand" id="collapseBtn1" href="javascript:void(0)" onclick="collapse(this,this.parentNode,20,150)" class="collapse">collapse</a>
		<h3>Pretraga</h3>
		
		<label class="left" for="filter_ulica">Ulica:</label>
		<input type="text" name="filter_ulica" id="filter_ulica" value="{{$filter_ulica}}" />
		<br clear="all" />
		<fieldset>
		  <legend>
			<select name="filter_tip_lok" id="filter_tip_lok" onchange="updateFilterLokacijeParent(this,Array('filter_grad_holder','filter_lokops_holder','filter_naselje_holder'))">
				<option value="-1">---</option>
				{{%loop start tip_id}}
				<option value="{{$tip_id}}" {{$selected_filter_tip}}>{{$tip_name}}</option>
				{{%loop end}}
			</select>
		  </legend>
		  	
			<span class="lokholder" id="filter_grad_holder" style="display:{{$display_fgrad}}">
				<select class="left" name="filter_grad" id="filter_grad">
					<option value="-1">---</option>
					{{%loop start grad_id}}
					<option value="{{$grad_id}}" title="{{$grad_id}}" {{$selected_grad}}>{{$grad_name}}</option>
					{{%loop end}}
				</select>
			</span>
			
			<span class="lokholder" id="filter_lokops_holder" style="display:{{$display_flokops}}">
				<select class="left" name="filter_lokops" id="filter_lokops">
					<option value="-1">---</option>
					{{%loop start lokops_id}}
					<option value="{{$lokops_id}}" title="{{$lokops_id}}" {{$selected_lokops}}>{{$lokops_name}}</option>
					{{%loop end}}
				</select>
			</span>
			
			<span class="lokholder" id="filter_naselje_holder" style="display:{{$display_fnaselje}}">
				<select class="left" name="filter_naselje" id="filter_naselje">
					<option value="-1">---</option>
					{{%loop start naselje_id}}
					<option value="{{$naselje_id}}" title="{{$naselje_id}}" {{$selected_naselje}}>{{$naselje_name}}</option>
					{{%loop end}}
				</select>
			</span>
			
		</fieldset>
		
		<input type="submit" value="filter" />
	</form>
	<br clear="all" />
	<form id="ullokNewForm" class="area" action="javascript:void(0)" onsubmit="submitForm(this,'geos.php','POST','alert',1)">
		<input type="hidden" name="a" value="ulice_lokacije" />
		<input type="hidden" name="mod" value="new" />
		<a title="collapse/expand" id="collapseBtn" href="javascript:void(0)" onclick="collapse(this,this.parentNode,20,229)" class="collapse">collapse</a>
		<h3 class="novi">Nova veza</h3>
		
		<label class="left" for="new_ulica">Ulica:</label>
		<input type="text" name="new_ulica_name" id="new_ulica_name" disabled="disabled" />
		<input type="hidden" name="new_ulica_id" id="new_ulica_id" />
		<input id="sel_komitent_ulica" type="button" class="btnUlicaSelect" title="promenite ulicu" onclick="searchUlice(this,'new_ulica_name','new_ulica_id')" />
		
		<br clear="all" />
		<fieldset>
		  <legend>
			<select name="new_tip_lok" id="new_tip_lok" onchange="updateFilterLokacijeParent(this,Array('new_grad_holder','new_lokops_holder','new_naselje_holder'))">
				<option value="-1">---</option>
				{{%loop start tip_id}}
				<option value="{{$tip_id}}">{{$tip_name}}</option>
				{{%loop end}}
			</select>
		  </legend>
		  	
			<span class="lokholder" id="new_grad_holder">
				<select class="left" name="new_grad" id="new_grad">
					{{%loop start grad_id}}
					<option value="{{$grad_id}}" title="{{$grad_id}}">{{$grad_name}}</option>
					{{%loop end}}
				</select>
			</span>
			
			<span class="lokholder" id="new_lokops_holder">
				<select class="left" name="new_lokops" id="new_lokops">
					{{%loop start lokops_id}}
					<option value="{{$lokops_id}}" title="{{$lokops_id}}">{{$lokops_name}}</option>
					{{%loop end}}
				</select>
			</span>
			
			<span class="lokholder" id="new_naselje_holder">
				<select class="left" name="new_naselje" id="new_naselje">
					{{%loop start naselje_id}}
					<option value="{{$naselje_id}}" title="{{$naselje_id}}" {{$selected_naselje}}>{{$naselje_name}}</option>
					{{%loop end}}
				</select>
			</span>
		</fieldset>
		
		<br clear="all" />
		<label class="left" for="new_desc">Opis:</label>
		<textarea name="new_desc" id="new_desc"></textarea>
		
		<br clear="all" />
		<input type="submit" value="sačuvaj" class="save" />
	</form>
  </div>
  <div style="float:left">
	<div class="area" id="ullok_result">
		{{$comment_start}}
		<table>
			<tr class="head" align="center">
				<td colspan="2">ulica</td>
				<td colspan="3">lokacija</td>
				<td>opis</td>
				<td></td>
			</tr>
			{{%loop start id}}
			<tr id="{{$id}}" valign="top">
				<td align="right">{{$ulid}}</td>
				<td>{{$ulname}}</td>
				<td align="right">{{$lokid}}</td>
				<td>{{$lokname}}</td>
				<td>{{$loktip}}</td>
				<td>{{$desc}}</td>
				<td><input type="button" class="delete" value="" onclick="LoadRSDoc('geos.php?a=ulice_lokacije&mod=delete&id={{$id}}','afterDeleteUllok')" /></td>
			</tr>
			{{%loop end}}
		</table>
		{{$comment_end}}
	</div>
  </div>
</div>
<script>
if(_CollapseTimeOut["ullokNewForm"]){
	clearTimeout(_CollapseTimeOut["ullokNewForm"])
}
collapse(document.getElementById('collapseBtn'),document.getElementById('ullokNewForm'),20,229);
</script>